import request from '@/utils/request'

// 登录
export const loginAPI = data => {
  return request({
    url: '/sys/login',
    method: 'POST',
    data
  })
}

// 用户信息
export const getUserInfoAPI = () => {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}

// 员工基本信息
export const getUserDetailByIdAPI = id => {
  return request({
    url: `/sys/user/${id}`
  })
}

// 保存员工基本信息
export const saveUserDetailByIdAPI = data => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
